package com.qf.freemarkerdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Controller
public class TestController {

    @RequestMapping("/test")
    public String test(Model model){
        System.out.println("==============");
        //将数据存入模型中
        model.addAttribute("data","我的freemarker数据");

        model.addAttribute("age",25);

        String[] strs = {"abc","dev","bbb"};
        model.addAttribute("list",strs);

        //页面跳转
        return "test";
    }
}
